package com.jackstraw.jack_base.util.tenant.contextholder;


import com.alibaba.ttl.TransmittableThreadLocal;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class TenantContextHolder {

    private static final ThreadLocal<String> tenantContextHolder = new TransmittableThreadLocal<>();

    public static void clear() {
        tenantContextHolder.remove();
    }

    public static void set(String tenantName) {
        tenantContextHolder.set(tenantName);
    }

    public static String get() {
        return tenantContextHolder.get();
    }

}
